package com.yang.proxy.staticproxy;

import com.yang.proxy.Buyer;

/**
 * 中介
 * @author yang
 * @version 0.1
 * @date 2019/4/12
 */
public class Intermediary implements Buyer {

    private Buyer buyer;

    public Intermediary(Buyer buyer) {
        this.buyer = buyer;
    }

    @Override
    public void house() {
        doBefore();
        buyer.house();
        doAfter();
    }

    private void doBefore() {
        System.out.println("寻找房源");
    }

    private void doAfter() {
        System.out.println("签署合同");
    }
}
